﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Bird.OAWeb.Domain.DTO;
using Bird.OAWeb.Domain.Table;
using Bird.OAWeb.EF;
using Bird.OAWeb.Ropesitory;
using Bird.OAWeb.Service;

namespace Bird.OAWeb.Service
{
    public class UserService:IUserService
    {
        IBaseRopesitory<User> user;
        public UserService(IBaseRopesitory<User> user)
        {
            this.user = user;
        }

        public UserDTO Loggin(UserDTO use)
        {
            var f = user.GetList().Where(x => x.UserName.Equals(use.UserName) && x.Password.Equals(use.Password)).FirstOrDefault();
            return use;
        }

        public int Logginadd(User obj)
        {
            return user.Inset(obj);
        }


    }
}
